#ifndef INC_MOVEVERTEXCMD_H
#define INC_MOVEVERTEXCMD_H

#include "Command.h"
#include "../model/UMLLine.h"

#include <QPoint>

class MoveVertexCmd : public Command
{
	public:
		MoveVertexCmd(UMLLine* line, UMLLine::size_type vertex);

		/*** ACCESSORS ***/

		const UMLLine* target() const;

		UMLLine::size_type vertex() const;

		QPoint pos() const;
		void setPos(const QPoint&);

		/*** COMMAND STUFF ***/

		void execute();
		void unexecute();
		bool useful() const;
		const char* name() const;

	private:

		bool _executed;

		UMLLine* _target;

		UMLLine::size_type _vertex;

		QPoint _pos;

		QPoint _oldPos;
};

inline const UMLLine* MoveVertexCmd::target() const
{
	return _target;
}

inline UMLLine::size_type MoveVertexCmd::vertex() const
{
	return _vertex;
}

inline QPoint MoveVertexCmd::pos() const
{
	return _pos;
}

inline void MoveVertexCmd::setPos(const QPoint& pos)
{
	_pos = pos;
}

#endif // INC_MOVEVERTEXCMD_H

